Skip to content

fix: support prettier-plugin-astro v1 - #473

Merged
Boshen merged 1 commit into
tailwindlabs:mainfrom
leaysgur:fix/astro-v1
Sep 29, 2026
Merged

Boshen merged 1 commit into
tailwindlabs:mainfrom
leaysgur:fix/astro-v1

Conversation

@leaysgur

@leaysgur leaysgur commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

prettier-plugin-astro v1 has been released, but it emits an ESTree/JSX AST from @astrojs/compiler-rs instead of its own element/attribute nodes (v0.x), so the Astro transform silently matched nothing.

Delegate to the JavaScript transform for the new root type and let dynamic attrs like class:list through the JSX attribute handler.

NOTE: Not breaking, v0.x is still supported alongside v1.
devDependencies follow the Svelte precedent (#462): track the latest major only.

@Boshen

Boshen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

@Princesseuh Can you help with review, thank you in advance!

@Princesseuh Princesseuh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me!

@Boshen
Boshen merged commit 5b27f94 into tailwindlabs:main Sep 29, 2026
1 check passed
@leaysgur
leaysgur deleted the fix/astro-v1 branch September 29, 2026 03:18
@GrahamCampbell

Copy link
Copy Markdown

Any chance of this being included in a tagged release please?

lobbystack added a commit to lobbystack/lobbystack that referenced this pull request Oct 8, 2026
ESLint stays on 9.39.4. The admin app loads eslint-plugin-jsx-a11y, and
its latest release (6.10.2) declares peer support up to ESLint 9 only.
The upstream issue (jsx-eslint/eslint-plugin-jsx-a11y#1075) and PR
(#1081) are still open. @eslint/js 10 requires ESLint 10, so it stays on
9.39.4 too. The other plugins are ready: typescript-eslint 8.71,
@next/eslint-plugin-next 16.3.8, eslint-plugin-react-refresh 0.5.7, and
eslint-plugin-react-hooks 7.1.1 (one minor above what we use). A trial
run of ESLint 10.12.0 linted both apps and found one new error: the
no-useless-assignment rule, new in the ESLint 10 recommended set, flags
clientName in the OAuth consent page.

globals goes to 17.13.0 in admin and landing. Version 17 moves the audio
worklet globals out of globals.browser. Neither app uses them, and lint
results match main: 21 admin warnings, no landing findings.

concurrently goes to 10.0.5, because 10.0.6 is younger than the 3-day
minimum. Version 10 ships as ESM only and moves its CLI to
dist/bin/index.js, so scripts/dev.mjs starts that file now. pnpm dev
also gets colored admin, worker and landing prefixes, the new default.

dotenv goes to 18.0.5, because 18.0.6 is younger than 3 days.
packages/db passes path and quiet to config(), and both behave as in 17.
The dotenv/config import in drizzle.config.ts no longer prints the
"injected env" line. Version 18 drops preloading and .env.vault, and the
repo uses neither.

@types/nodemailer goes to 8.0.2. Its one type change moves href from
the AMP and iCal attachment types to every attachment, and the SMTP
provider doesn't set it.

prettier-plugin-tailwindcss goes to 0.8.1, which needs Prettier 3.7 or
newer (landing has 3.9.9). prettier --check in apps/landing flags the
same 134 files as on main, so the new version changes no output.

prettier-plugin-astro stays on 0.14.1. With 1.x, the Tailwind plugin
stops sorting classes in .astro templates.
tailwindlabs/prettier-plugin-tailwindcss#473 fixes that, but no release
includes it yet. The 1.x rewrite also reformats 22 .astro files that
pass the check today: it unwraps expression blocks from their own
braces lines and keeps a long lone attribute on the tag's line.
murugu-21 added a commit to murugu-21/murugu-21.github.io that referenced this pull request Oct 10, 2026
ESLint covered what oxc can't parse, .astro templates and stylesheets, and
needed typescript-eslint on a TypeScript 6 alias, tailwind-csstree in tolerant
mode and three plugins to do it. Biome 2.5 parses both.

- Biome lints .astro templates (a11y, Astro directives, inline styles,
  Tailwind arbitrary values, raw colours and shorthands) and lints and formats
  CSS. Two GritQL plugins in tooling/biome/ replace no-restricted-syntax:
  Tailwind-only stylesheets with no <style> blocks in .astro, and cva() over a
  ternary inside cn(). plugins.test.ts runs Biome on fixtures.
- Prettier keeps formatting .astro until oxfmt supports it
  (oxc-project/oxc#27386). Biome's HTML formatter breaks lines where Astro
  then drops spaces.
- prettier-plugin-tailwindcss sorts .astro classes with Tailwind's own engine.
  0.8.1 can't read prettier-plugin-astro 1, so it is pinned to
  0.0.0-insiders.5b27f94, the npm build of the fix
  (tailwindlabs/prettier-plugin-tailwindcss#473). Renovate allows only a
  stable release above 0.8.1.
- Astro 7's compressHTML ("jsx") deletes whitespace holding a newline beside a
  tag or expression, so /developers read "metered at3" and "v1 iscurrent" and
  the greeting read "Hi There!👋". Each now has an explicit {" "}.
  tooling/astro-whitespace.ts parses templates with Astro's compiler and its
  test fails on any line break that joins words or space that pads an inline
  element.
- Tailwind 4's before:/after: utilities already set content, so the redundant
  content-[''] classes go. The back-to-top button gets type="button".
- Not checked in .astro for now: unknown, conflicting and duplicate Tailwind
  classes, and class:list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FadkPUYZtBNKYfjTxm2RfJ
murugu-21 added a commit to murugu-21/murugu-21.github.io that referenced this pull request Oct 16, 2026
ESLint covered what oxc can't parse, .astro templates and stylesheets, and
needed typescript-eslint on a TypeScript 6 alias, tailwind-csstree in tolerant
mode and three plugins to do it. Biome 2.5 parses both.

- Biome lints .astro templates (a11y, Astro directives, inline styles,
  Tailwind arbitrary values, raw colours and shorthands) and lints and formats
  CSS. Two GritQL plugins in tooling/biome/ replace no-restricted-syntax:
  Tailwind-only stylesheets with no <style> blocks in .astro, and cva() over a
  ternary inside cn(). plugins.test.ts runs Biome on fixtures.
- Prettier keeps formatting .astro until oxfmt supports it
  (oxc-project/oxc#27386). Biome's HTML formatter breaks lines where Astro
  then drops spaces.
- prettier-plugin-tailwindcss sorts .astro classes with Tailwind's own engine.
  0.8.1 can't read prettier-plugin-astro 1, so it is pinned to
  0.0.0-insiders.5b27f94, the npm build of the fix
  (tailwindlabs/prettier-plugin-tailwindcss#473). Renovate allows only a
  stable release above 0.8.1.
- Astro 7's compressHTML ("jsx") deletes whitespace holding a newline beside a
  tag or expression, so /developers read "metered at3" and "v1 iscurrent" and
  the greeting read "Hi There!👋". Each now has an explicit {" "}.
  tooling/astro-whitespace.ts parses templates with Astro's compiler and its
  test fails on any line break that joins words or space that pads an inline
  element.
- Tailwind 4's before:/after: utilities already set content, so the redundant
  content-[''] classes go. The back-to-top button gets type="button".
- Not checked in .astro for now: unknown, conflicting and duplicate Tailwind
  classes, and class:list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FadkPUYZtBNKYfjTxm2RfJ
@torbet

torbet commented Nov 4, 2026

Copy link
Copy Markdown

@Boshen @Princesseuh Just a quick bump that it would be great to get this in a release! :D

@Princesseuh

Copy link
Copy Markdown
Contributor

I do not have the power to do releases of this, neither does Boshen I think. @RobinMalfait perhaps can help?

@toxsick

toxsick commented Nov 12, 2026

Copy link
Copy Markdown

Hey @RobinMalfait, hope you find the time to have a look into this soon. Thanks a lot!

@devenini

Copy link
Copy Markdown

@RobinMalfait we need you 🙏 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants